/*
 * @Description:
 * @Version: 1.0
 * @Autor: linyikang
 * @LastEditors: linyikang
 * @Date: 2023-12-06 18:57:13
 * @LastEditTime: 2023-12-06 19:29:37
 */
import enterpriseApi from '@/api/modules/enterpriseApi'
import { watch, getCurrentInstance, ref } from 'vue'

export const useRiskColor = () => {
  const riskColor = ref<any>([])
  const getRiskColor = () => {
    enterpriseApi.getFindColorByRisk().then((res) => {
      if (res.success) {
        riskColor.value = res.body
        window.localStorage.setItem('riskColor', JSON.stringify(riskColor.value))
      }
    })
  }
  let list = JSON.parse(window.localStorage.getItem('riskColor') as any)
  if (list && list.length > 0) {
    riskColor.value = list
  } else {
    getRiskColor()
  }
  return {
    riskColor
  }
}
